package com.keguoyu.easymvp.commons;

import java.util.Set;

import com.keguoyu.easymvp.commons.supplier.SupplierContainer;

public class ValueTakerImpl extends ValueTaker {

  @Override
  public <T> T take(SupplierContainer obj, String fieldName) {
    return obj.fetch(fieldName);
  }

  @Override
  public <T> T take(SupplierContainer obj, Class<T> tClass) {
    return obj.fetch(tClass);
  }

  @Override
  public <T> void set(SupplierContainer obj, String fieldName, T value) {
    obj.set(fieldName, value);
  }

  @Override
  public <T> void set(SupplierContainer obj, Class tClass, T value) {
    obj.set(tClass, value);
  }

  @Override
  public Set<String> allFieldNames(SupplierContainer obj) {
    return obj.allNames();
  }

  @Override
  public Set<Class> allTypes(SupplierContainer obj) {
    return obj.allTypes();
  }

  @Override
  public Set<Object> allDirectFields(SupplierContainer obj) {
    return obj.allValues();
  }
}
